import {
    createRouter,
    createWebHashHistory
} from "vue-router";
import { stringifyQuery, parseQuery } from "@/utils/routerParamsEncryption/query.js";

const router = createRouter({
    stringifyQuery: stringifyQuery,
    parseQuery: parseQuery,
    history: createWebHashHistory(),
    routes: [{
            path: "/",
            name: "layout",
            redirect: "/home",
            component: () => import("../views/layout/index.vue"),
            children: [{
                    path: "/home",
                    name: "home",
                    component: () => import("../views/home/index.vue")
                },
                {
                    path: "/routerParamsEncryption",
                    name: "routerParamsEncryption",
                    component: () => import("../views/routerParamsEncryption/index.vue")
                },
                {
                    path: "/jsFunc",
                    name: "jsFunc",
                    component: () => import("../views/jsFunc/index.vue")
                },
                {
                    path: "/mobileScheme",
                    name: "mobileScheme",
                    component: () => import("../views/mobileScheme/index.vue")
                },

            ]
        },
        {
            path: '/:pathMatch(.*)*',
            name: 'NotFound',
            redirect: "/home",
        },
    ]
})

export default router;
